#import "UIView+Frame.h"

@implementation UIView (Frame)

-(CGFloat)x
{
    return self.frame.origin.x;
}

-(CGFloat)y
{
    return self.frame.origin.y;
}

-(CGFloat)w
{
    return self.frame.size.width;
}

-(CGFloat)h
{
    return self.frame.size.height;
}

-(void)setX:(CGFloat)x
{
    CGRect frame = self.frame;
    
    frame.origin.x = x;
    
    self.frame = frame;
}

-(void)setY:(CGFloat)y
{
    CGRect frame = self.frame;
    
    frame.origin.y = y;
    
    self.frame = frame;
}

-(void)setW:(CGFloat)w
{
    CGRect frame = self.frame;
    
    frame.size.width = w;
    
    self.frame = frame;
}

-(void)setH:(CGFloat)h
{
    CGRect frame = self.frame;
    
    frame.size.height = h;
    
    self.frame = frame;
}


-(CGSize)size
{
    return self.frame.size;
}

-(void)setSize:(CGSize)size
{
    CGRect frame = self.frame;
    
    frame.size = size;
    
    self.frame = frame;
}

-(CGPoint)origin
{
    return self.frame.origin;
}

-(void)setOrigin:(CGPoint)origin
{
    CGRect frame = self.frame;
    
    frame.origin = origin;
    
    self.frame = frame;
}




@end
